﻿using System;

namespace WpfAGVSystem.Model
{
    public partial class AGVStateServer
    {

        public float _coord_X { get; set; }
        public float _coord_Y { get; set; }

        public float Coord_X
        {
            get=> _coord_X;
            set
            {
                _coord_X = value;
                AGVModel.AGVViewModel.Location = new System.Windows.Point((int)_coord_X,(int) _coord_Y);
            }
        }
        public float Coord_Y
        {
            get => _coord_Y;
            set
            {
                _coord_Y = value;
                AGVModel.AGVViewModel.Location = new System.Windows.Point((int)_coord_X, (int)_coord_Y);
            }
        }
        private float confidence { get; set; }
        public float Confidence
        {
            get => confidence;
            set
            {
                confidence = value;
                AGVModel.AGVViewModel.Confidence =confidence.ToString("f2");
            }
        }
        private bool _alarm;
        public bool Alarm
        {
            get => _alarm;
            set
            {
                _alarm = value;
                AGVModel.AGVViewModel.AGVAlarm = value;
            }
        }
        private float _aGVSpeed;
        public float AGVSpeed
        {
            get => _aGVSpeed;
            set
            {
                _aGVSpeed = value;
             //   AGVModel.AGVViewModel.AGVSpeed = Double.Parse(_aGVSpeed.ToString());
              //  AGVModel.AGVViewModel.DrivingStatus = _aGVSpeed == 0 ? StringProcess.STOPSTR : StringProcess.DOWNWARDSTR;

            }
        }
        private bool _lowBattery;
        public bool LowBattery
        {
            get => _lowBattery;
            set
            {
                _lowBattery = value;
                AGVModel.AGVViewModel.LowBattery = value;
            }
        }
        private bool _connected;
        public bool Connected
        {
            get => _connected;
            set
            {
                _connected = value;
                AGVModel.AGVViewModel.Connected = _connected;
            }
        }
        public float Angle { get; set; }
        public int CurrentNavigateStation { get; set; }
        public AGVLocateStateEnum LocateState { get; set; }

        //开环下发机器人 VX 速度
        public float AGV_VX { get; set; }

        public string AGVState_DI_ReadOnly { get; set; }
        public string AGVState_AI_ReadOnly { get; set; }

        public bool bemergencyStop { get; set; }
        /// <summary>
        /// 当AGV被拍急停的时候 把执行下发路径规划停掉 等急停扭开重新执行路径规划
        /// </summary>
        public bool bEmergencyStop
        {
            get { return bemergencyStop; }
            set
            {
                bemergencyStop = !value;
                AGVModel.BEmergencyStop = bemergencyStop;
            }
        }

    }
}